VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form frmACP100 
   BackColor       =   &H8000000D&
   Caption         =   "ACP100"
   ClientHeight    =   5025
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9600
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   ScaleHeight     =   5025
   ScaleWidth      =   9600
   StartUpPosition =   3  'Windows Default
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   330
      Left            =   7245
      Top             =   75
      Visible         =   0   'False
      Width           =   1950
      _ExtentX        =   3440
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "2. APT"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   4905
      Top             =   75
      Visible         =   0   'False
      Width           =   1965
      _ExtentX        =   3466
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "1.AVM"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00E0E0E0&
      BorderStyle     =   0  'None
      Caption         =   "Frame1"
      Height          =   2550
      Left            =   165
      TabIndex        =   10
      Top             =   1695
      Width           =   9165
      Begin VB.TextBox txtVMNME 
         BeginProperty Font 
            Name            =   "VNI-Times"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Left            =   6390
         TabIndex        =   30
         Top             =   120
         Width           =   2550
      End
      Begin MSDataListLib.DataCombo cboVMTPM 
         Bindings        =   "frmACP100.frx":0000
         Height          =   375
         Left            =   1710
         TabIndex        =   29
         Top             =   1470
         Visible         =   0   'False
         Width           =   2955
         _ExtentX        =   5212
         _ExtentY        =   661
         _Version        =   393216
         ListField       =   "PTDSC"
         BoundColumn     =   "PTPTC"
         Text            =   ""
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "VNI-Times"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.TextBox txtPTDSC 
         BeginProperty Font 
            Name            =   "VNI-Times"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   405
         Left            =   2610
         TabIndex        =   28
         Top             =   1455
         Width           =   2085
      End
      Begin VB.TextBox txtVMTPM 
         BeginProperty Font 
            Name            =   "VNI-Times"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   405
         Left            =   1710
         TabIndex        =   27
         Top             =   1470
         Width           =   855
      End
      Begin VB.TextBox txtVMADD 
         BeginProperty Font 
            Name            =   "VNI-Times"
            Size            =   11.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   345
         Left            =   1710
         TabIndex        =   26
         Top             =   525
         Width           =   2970
      End
      Begin VB.TextBox txtVMYPA 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   345
         Left            =   4395
         Locked          =   -1  'True
         MultiLine       =   -1  'True
         TabIndex        =   24
         Top             =   1950
         Width           =   2250
      End
      Begin VB.ComboBox cboVMDLV 
         Height          =   315
         ItemData        =   "frmACP100.frx":0015
         Left            =   6420
         List            =   "frmACP100.frx":0025
         TabIndex        =   23
         Top             =   1530
         Width           =   1635
      End
      Begin VB.ComboBox cboVMTYP 
         Height          =   315
         ItemData        =   "frmACP100.frx":0039
         Left            =   1710
         List            =   "frmACP100.frx":0046
         TabIndex        =   21
         Top             =   960
         Width           =   1635
      End
      Begin VB.TextBox txtVMFax 
         Height          =   288
         HideSelection   =   0   'False
         Left            =   6405
         TabIndex        =   16
         Top             =   1035
         Width           =   1380
      End
      Begin VB.TextBox txtVMTEL 
         Height          =   288
         HideSelection   =   0   'False
         Left            =   6405
         TabIndex        =   14
         Top             =   585
         Width           =   1380
      End
      Begin VB.TextBox txtVMVDN 
         Height          =   315
         Left            =   1710
         TabIndex        =   13
         Top             =   90
         Width           =   1305
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Y-T-D Purchased amount"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   9
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   240
         Index           =   11
         Left            =   1590
         TabIndex        =   25
         Top             =   2010
         Width           =   2670
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Level performance"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   225
         Index           =   10
         Left            =   4740
         TabIndex        =   22
         Top             =   1560
         Width           =   1755
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Vendor Type"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   225
         Index           =   9
         Left            =   120
         TabIndex        =   20
         Top             =   1110
         Width           =   1170
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Term Of payment"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   225
         Index           =   8
         Left            =   120
         TabIndex        =   19
         Top             =   1575
         Width           =   1590
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Vendor Address"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   225
         Index           =   7
         Left            =   120
         TabIndex        =   18
         Top             =   600
         Width           =   1485
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Vendor Fax"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   225
         Index           =   6
         Left            =   5325
         TabIndex        =   17
         Top             =   1065
         Width           =   990
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Vendor Tel"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   225
         Index           =   4
         Left            =   5340
         TabIndex        =   15
         Top             =   645
         Width           =   990
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Vendor code"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   225
         Index           =   5
         Left            =   120
         TabIndex        =   12
         Top             =   165
         Width           =   1140
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Vendor Name"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   7.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   225
         Index           =   3
         Left            =   5130
         TabIndex        =   11
         Top             =   180
         Width           =   1215
      End
   End
   Begin VB.CommandButton cmdDelete 
      Caption         =   "&Delete"
      Height          =   372
      Left            =   5790
      TabIndex        =   7
      Top             =   4500
      Width           =   960
   End
   Begin VB.CommandButton cmdAddnew 
      Caption         =   "&New"
      Height          =   372
      Left            =   1560
      TabIndex        =   4
      Top             =   4515
      Width           =   996
   End
   Begin VB.CommandButton cmdEdit 
      Caption         =   "&Edit"
      Height          =   372
      Left            =   2625
      TabIndex        =   3
      Top             =   4500
      Width           =   948
   End
   Begin VB.CommandButton cmdSave 
      Caption         =   "&Save"
      Height          =   372
      Left            =   3660
      TabIndex        =   2
      Top             =   4500
      Width           =   984
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "&Cancel"
      Height          =   372
      Left            =   4695
      TabIndex        =   1
      Top             =   4500
      Width           =   1032
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "&Exit"
      Height          =   372
      Left            =   6810
      TabIndex        =   0
      Top             =   4500
      Width           =   1080
   End
   Begin MSDataListLib.DataCombo cboVMVDN 
      Bindings        =   "frmACP100.frx":0056
      Height          =   375
      Left            =   3525
      TabIndex        =   8
      Top             =   1200
      Width           =   3435
      _ExtentX        =   6059
      _ExtentY        =   661
      _Version        =   393216
      ListField       =   "VMNME"
      BoundColumn     =   "VMVDN"
      Text            =   ""
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "VNI-Times"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "Select Vendor"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   7.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0080FFFF&
      Height          =   225
      Index           =   2
      Left            =   2040
      TabIndex        =   9
      Top             =   1290
      Width           =   1320
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "ACP100"
      BeginProperty Font 
         Name            =   "VNI-Present"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   -1  'True
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   465
      Index           =   0
      Left            =   75
      TabIndex        =   6
      Top             =   15
      Width           =   1680
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "VENDER MASTER MAINTENANCE"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   16.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   495
      Index           =   1
      Left            =   1605
      TabIndex        =   5
      Top             =   660
      Width           =   6150
   End
End
Attribute VB_Name = "frmACP100"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim OldVMVDN As String
Private Sub WriteToFile()
Dim SQLInsert As String, LastDate
LastDate = Format(Now(), "yyyy-mm-dd hh:mm:ss")

If ISADDING Then
    SQLInsert = "INSERT INTO AVM " & _
      "(VMVDN,VMNME,VMADD" & _
      ",VMTEL,VMFAX" & _
      ",VMTYP,VMTPM" & _
      ",VMYPA,VMDLV" & _
      ",VMRID,VMLDT,VMLUS) " & _
    " VALUES " & _
      "('" & txtVMVDN & "', '" & txtVMNME & "','" & txtVMADD & "'" & _
      ",'" & txtVMTEL & "','" & txtVMFax & "'" & _
      ",'" & Left(cboVMTYP.List(cboVMTYP.ListIndex), 1) & "','" & txtVMTPM & "'" & _
      "," & txtVMYPA & ",'" & Left(cboVMDLV.List(cboVMDLV.ListIndex), 1) & "'" & _
      ",'VM','" & LastDate & "','" & UserLogin & "')"
 Else
    SQLInsert = "UPDATE AVM SET VMVDN = '" & txtVMVDN & "', VMNME ='" & txtVMNME & "',VMADD='" & txtVMADD & "'" & _
      ",VMTEL='" & txtVMTEL & "',VMFax ='" & txtVMFax & "'" & _
      ",VMTYP='" & Left(cboVMTYP.List(cboVMTYP.ListIndex), 1) & "',VMTPM='" & txtVMTPM & "'" & _
      ",VMYPA=" & txtVMYPA & ",VMDLV='" & Left(cboVMDLV.List(cboVMDLV.ListIndex), 1) & "'" & _
      ",VMLDT='" & LastDate & "',VMLUS='" & UserLogin & "' " & _
      " WHERE VMVDN ='" & OldVMVDN & "'"
End If
MsgBox SQLInsert
DBconn.Execute SQLInsert
End Sub

Private Sub WriteToScreen()
If ISADDING Then 'gan rong
    cboVMVDN.BoundText = ""
    txtVMVDN = ""
    txtVMNME = ""
    txtVMADD = ""
    txtVMTEL = ""
    txtVMFax = ""
    cboVMTYP.ListIndex = -1
    txtVMTPM = ""
    txtPTDSC = ""
    txtVMYPA = 0
    cboVMDLV.ListIndex = -1
Else
    Dim TBL As ADODB.Recordset
    Set TBL = New ADODB.Recordset
    TBL.Open "  Select AVM.* From AVM where  VMVDN ='" & cboVMVDN.BoundText & "'", DBconn, adOpenKeyset, adLockOptimistic, adCmdText
    If TBL.EOF = False Then
        txtVMVDN = IIf(IsNull(TBL!VMVDN), "", TBL!VMVDN)
        cboVMVDN.BoundText = txtVMVDN
        txtVMNME = IIf(IsNull(TBL!VMNME), "", TBL!VMNME)
        txtVMADD = IIf(IsNull(TBL!VMADD), "", TBL!VMADD)
        txtVMTEL = IIf(IsNull(TBL!VMTEL), "", TBL!VMTEL)
        txtVMFax = IIf(IsNull(TBL!VMFAX), "", TBL!VMFAX)
        'cboVMTYP = IIf(IsNull(TBL!VMTYP), "", TBL!VMTYP)
        If Not IsNull(TBL!VMTYP) Then
            For i = 0 To cboVMTYP.ListCount - 1
                If Left(cboVMTYP.List(i), 1) = TBL!VMTYP Then
                    cboVMTYP.ListIndex = i
                    Exit For
                End If
            Next i
        Else
            cboVMTYP.ListIndex = -1
        End If
        txtVMTPM = IIf(IsNull(TBL!VMTPM), "", TBL!VMTPM)
        txtPTDSC = Find("APT", "PTDSC", " WHERE PTPTC='" & txtVMTPM & "'")
        txtVMYPA = IIf(IsNull(TBL!VMYPA), 0, TBL!VMYPA)
        'cboVMDLV = IIf(IsNull(TBL!VMDLV), "", TBL!VMDLV)
        If Not IsNull(TBL!VMDLV) Then
            For i = 0 To cboVMDLV.ListCount - 1
                If Left(cboVMDLV.List(i), 1) = TBL!VMDLV Then
                    cboVMDLV.ListIndex = i
                    Exit For
                End If
            Next i
        Else
            cboVMDLV.ListIndex = -1
        End If
    Else
        cboVMVDN.BoundText = ""
        txtVMVDN = ""
        txtVMNME = ""
        txtVMADD = ""
        txtVMTEL = ""
        txtVMFax = ""
        cboVMTYP.ListIndex = -1
        txtVMTPM = ""
        txtVMYPA = 0
        cboVMDLV.ListIndex = -1
    End If
    TBL.Close
End If
OldVMVDN = txtVMVDN
End Sub

Sub ButtonStatus()
cmdAddnew.Enabled = Not ISEDITING
cmdEdit.Enabled = Not ISEDITING
cmdSave.Enabled = ISEDITING ' And txtIMITN <> ""
cmdDelete.Enabled = Not ISEDITING 'And txtIMITN <> ""
cmdCancel.Enabled = ISEDITING
Frame1.Enabled = ISEDITING
'txtIMITN.Locked = Not ISADDING ' Lock item code tru truong hop ISADDING=true
'txtDepartment.Enabled = ISEDITING
'cboDepartment.Visible = Not ISADDING
'txtDepartmentID.Visible = ISADDING
End Sub



Private Sub cboVMTPM_Click(Area As Integer)
If Area = 2 Then
    txtVMTPM = cboVMTPM.BoundText
    txtPTDSC = cboVMTPM.Text
    cboVMTPM.Visible = False
    cboVMDLV.SetFocus
End If
End Sub

Private Sub cboVMTYP_Click()
If txtVMFax.Enabled Then txtVMFax.SetFocus
End Sub

Private Sub cboVMVDN_Click(Area As Integer)
If Area = 2 Then
    WriteToScreen
End If


End Sub

Private Sub cmdAddnew_Click()
ISADDING = True
ISEDITING = True
WriteToScreen

' Ham Gan tri man hinh
ButtonStatus

End Sub

Private Sub cmdCancel_Click()
' Gan tri man nhinh
ISADDING = False
ISEDITING = False

ButtonStatus
txtVMVDN = cboVMVDN.BoundText
WriteToScreen


End Sub

Private Sub cmdDelete_Click()
Dim SQL As String
SQL = "DELETE FROM AVM  WHERE VMVDN = '" & cboVMVDN.BoundText & "'"

Set cmdExecute = New ADODB.Command
Set cmdExecute.ActiveConnection = DBconn
cmdExecute.CommandText = SQL
cmdExecute.Execute
Adodc1.Refresh


End Sub

Private Sub cmdEdit_Click()

' Ham gan tri man hinh
ISADDING = False
ISEDITING = True


ButtonStatus

End Sub

Private Sub cmdExit_Click()
Unload frmACP100
End Sub

Private Sub cmdSave_Click()

WriteToFile
Adodc1.Refresh

'''''''''''
ISADDING = False
ISEDITING = False

ButtonStatus


End Sub

Private Sub Form_Load()
BIENCHUNG
Adodc1.ConnectionString = ConnectString
Adodc1.ConnectionTimeout = 10
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "AVM" 'SALEMAN
Adodc1.Refresh

Adodc2.ConnectionString = ConnectString
Adodc2.ConnectionTimeout = 10
Adodc2.CommandType = adCmdTable
Adodc2.RecordSource = "APT" 'Term Of Payment
Adodc2.Refresh


ISADDING = False
ISEDITING = False
ButtonStatus

End Sub

Private Sub txtVMADD_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtVMTEL.SetFocus
End If
End Sub

Private Sub txtVMFax_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtVMTPM.SetFocus
End If
End Sub

Private Sub txtVMNME_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtVMADD.SetFocus
End If
End Sub

Private Sub txtVMTEL_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    cboVMTYP.SetFocus
End If
End Sub

Private Sub txtVMTPM_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    Dim Result As String

    Result = Find("APT", "PTDSC", " WHERE PTPTC='" & txtCMPTC & "'")
    If Result <> "" Then
        txtPTDSC = Result
        cboVMDLV.SetFocus
    Else
        cboVMTPM.Visible = True
        cboVMTPM.SetFocus
    End If
    

    
End If
End Sub

Private Sub txtVMVDN_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    If ValidMaso(OldVMVDN, txtVMVDN, "AVM", " VMVDN='" & txtVMVDN & "'") Then
        MsgBox "This code is already exist"
        txtVMVDN.SetFocus
    Else
        txtVMNME.SetFocus
    End If
End If
End Sub
